from django.http.response import HttpResponse
from django.shortcuts import render

# Create your views here.
from db2.models import BookInfo


def option(request):
	# 创建sql语句
	# book = BookInfo.objects.all()

	# 进行调用去mysql执行
	# [temp for temp in book]
	# [temp for temp in book]
	# [temp for temp in BookInfo.objects.all()]
	# [temp for temp in BookInfo.objects.all()]

	# 分页
	book = BookInfo.objects.all()[2:4]

	print(book)

	return HttpResponse('db操作')
